When save operation is performed on a placeholder tab, we add that tab to the working set#2356
Merged
When save operation is performed on a placeholder tab, we add that tab to the working set#2356
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR ensures that when the save operation is performed we add the placeholder tab to the working set. This is the most intuitive UX as most mainline editors has this UX.
Note: When working on it, noticed that beforeExecuteCommand is not listening for any commands that is done through the UI. I mean that if the save/save all or any other similar operation is performed using the keyboard shortcut then it listened for those commands but when those operations are performed using the UI (File menu > Save) or anything similar, then beforeExecuteCommand was not listening to the commands.
Root cause: Found that the issue was because menu clicks were calling Command.prototype.execute() directly instead of using CommandManager.execute(). This was bypassing the command event system.
Fix: Changed the menu click handler in Menus.js to use CommandManager.execute() so that all commands (keyboard shortcuts AND menu clicks) go through the same path and trigger beforeExecuteCommand properly.
This PR doesn't break any existing functionality - just makes the command execution consistent.